{include file="public/header"}
<style type="text/css">
	#wrapper {
        width: 100%;
        position: absolute;
        left: 0;
        top: 40px;
        overflow: hidden;
        z-index: 1;
        /* 防止本机Windows上的触摸事件 */
        -ms-touch-action: none;
        /* 防止callout tap-hold和文本的选择 */
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        /* 防止文本调整取向变化对web应用程序很有用 */
        -webkit-text-size-adjust: none;
        -moz-text-size-adjust: none;
        -ms-text-size-adjust: none;
        -o-text-size-adjust: none;
        text-size-adjust: none;
    }
    .pull-loading {
        text-align: center;
        height: 40px;
        line-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
		color: #fff;
    }
	.an_section1 .f1{
		border-bottom: 1px solid #eee !important;
	}
	.an_section1 .f1 .im2{
		width: 20px;
		position: relative;
		top: 16px;
	}
	.an_section1 .f1 .big{
		background: url("__PUBLIC__/home/images/v10_a51.png");
		background-size: 100% 100%;
		padding: 10px;
		padding-left: 15px;
	}
	.an_section1 .f1 .p1 .s1{
		color: #07bcf0;
		font-size: 1.1rem;
		font-weight: bolder;
	}
	.an_section1 .f1 .p2{
		margin-top: 10px;
		color: #fff;
		text-align: left;
		width: 80%;
		padding-bottom: 8px;
		font-size: 0.8rem;
	}
</style>
<body class="she_body">
<div class="bg_fixed_v10_1"></div>
	<div class="sectionY sectionY_tttt">
		<a href="JavaScript:history.back();">
			<img src="__PUBLIC__/home/images/v10_a9.png" alt="" class="a1">
		</a>
		<p class="p1">
			<span class="ppp_title">系统消息</span>
		</p>
	</div>
	<div class="kong1"></div>
	<div class="an_section1" id='wrapper'>
        <div id="scroller">
            <div class="ttrr">
                {foreach name='list' item='v'}
            		<div class="f1 clearfix">
            			<div class="big">
							<a href="{:url('News/details',['id'=>$v['id']])}">
								<div class="clearfix">
									<p class="p1 news_list_item chao">
										<span class="s1">{$v.title}</span>
									</p>

									<img src="__PUBLIC__/home/images/a23_1yy.png" alt="" class="im2">
								</div>
								<p class="p2 chao">简介</p>
							</a>
						</div>
            		</div>
                {/foreach}
            </div>
            <div class="pull-loading">上拉加载</div>
        </div>
	</div>
</body>
</html>
<script type="text/javascript">
    $(function(){
        var dd = $("#wrapper").offset().top;
        $("#wrapper").css("height",($(window).height()-dd-50));
    })
</script>
<script type="text/javascript">
    var myscroll = new iScroll("wrapper", {
        onScrollMove: function () { //拉动时
            //上拉加载
            if (this.y < this.maxScrollY) {
                $(".pull-loading").html("释放加载");
                $(".pull-loading").addClass("loading");
            } else {
                $(".pull-loading").html("上拉加载");
                $(".pull-loading").removeClass("loading");
            }
        },
        onScrollEnd: function () { //拉动结束时
            //上拉加载
            if ($(".pull-loading").hasClass('loading')) {
                $(".pull-loading").html("加载中...");
                pullOnLoad();
            }
        }
    });
    //上拉加载函数,ajax
    var num = 1;
    function pullOnLoad() {
        num++;
        $.ajax({
            type:'post',
            url:"{:url('News/ajaxmore')}",
            data:{page:num},
            cache:false,
            dataType:'JSON',
            success:function(data){
                //console.log(data);return;
                if(data.length<=0){
                    $('.pull-loading').html("已加载全部");
                }else{
                    var html = '';
                    for(var i=0;i<data.length;i++){
                        var url = "{:url('News/details')}?id="+data[i]['id'];
                        html += '<div class="f1 clearfix">';
						html += '<div class="big clearfix">';
                        html += '      			<a href="'+url+'">';
						html += '<div class=" clearfix">';
                        html += '        				<p class="p1 news_list_item chao">';
                        html += '        					<span class="s1">'+data[i]['title']+'</span>';
                        html += '        				</p>';
                        html += '        				<img src="__PUBLIC__/front/images/a23.png" alt="" class="im2">';
						html += '        		</div>';
						html += '        				<p class="p1 news_list_item chao">';
						html += '        				</p>';
                        html += '        			</a>';
                        html += '        		</div>';
						html += '        		</div>';

                    }
                    $("#scroller .ttrr").append(html);
                    $('.pull-loading').html("上拉加载");
                }
				myscroll.refresh();
            }
        });
    }
    pullOnLoad();
</script>
